﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'usp_UPDMS_FIT_TRAINING_TYPE_Update')
	BEGIN
		DROP Procedure usp_UPDMS_FIT_TRAINING_TYPE_Update
	END
GO

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
GO
/******************************************************************************
**	Name : usp_UPDMS_FIT_TRAINING_TYPE_Update
**	Desc : 운동종류관리를 수정한다.
**	Test Exec Query : Exec usp_UPDMS_FIT_TRAINING_TYPE_Update
**	Called by : Fit_Dac_UPDMS_FIT_TRAINING_TYPE.cs
**	Program ID : Fit1010m
**	Auth : 송시명
**	Date : 2014-05-19
*******************************************************************************
**	Change History
*******************************************************************************
**	Date:		Author:		Description:
**	--------	--------	---------------------------------------
**	
*******************************************************************************/
CREATE PROC [dbo].[usp_UPDMS_FIT_TRAINING_TYPE_Update]
@Seq int,
@Training_Type_Id nvarchar(5),
@Training_Part nvarchar(5),
@Training_Nm nvarchar(200),
@Training_Muscle_Major nvarchar(max),
@Training_Muscle_Minor nvarchar(max),
@Howto nvarchar(max),
@Precaution nvarchar(max),
@Tip nvarchar(max),
@Weight_Calc_Rate decimal(10,1),
@View_Order nvarchar(5),
@Favorite_Yn nvarchar(1),
@Use_Yn nvarchar(1),
@Attach_File_Info nvarchar(max),
@Create_User nvarchar(20),
@Create_Dt datetime,
@Update_User nvarchar(20),
@Update_Dt datetime
AS
SET NOCOUNT OFF

UPDATE UPDMS_FIT_TRAINING_TYPE
   SET Training_Type_Id = @Training_Type_Id,
       Training_Part = @Training_Part,
	   Training_Nm = @Training_Nm,
	   Training_Muscle_Major = @Training_Muscle_Major,
	   Training_Muscle_Minor = @Training_Muscle_Minor,
       Howto = @Howto,
       Precaution = @Precaution,
	   Tip = @Tip,
	   Weight_Calc_Rate = @Weight_Calc_Rate,
	   View_Order = @View_Order,
       Favorite_Yn = @Favorite_Yn,
       Use_Yn = @Use_Yn,
       Update_User = @Update_User,
       Update_Dt = GETDATE()
 WHERE Seq = @Seq

--첨부파일 저장
EXEC usp_UPDMS_COM_FILE_Insert_Xml @Seq, 'Fit1010m', @Attach_File_Info

GO